package com.example.shopp_2301.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * vp适配器   需要传入几个参数 对应的VPAdapter(放几个参数)
 */
class VpAdapter(fragmentActivity: FragmentActivity,val list: MutableList<Fragment>):FragmentStateAdapter(fragmentActivity) {
    override fun getItemCount(): Int {
        return list.size
    }

    override fun createFragment(position: Int): Fragment {
        return list.get(position)
    }
}